<template>
	<el-drawer title="培训计划详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="排序号" prop="sortNo">{{form.sortNo}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="计划编号" prop="trainCode">{{form.trainCode}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="培训标题" prop="title">{{form.title}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="培训总人数" prop="userCount">{{form.userCount}}/人
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="培训渠道" prop="channel">{{form.channelName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="培训类型" prop="courseType">{{form.courseTypeName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="主办部门" prop="holdDept">{{form.holdDept}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="培训负者人" prop="chargePerson">{{form.chargePerson}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="培训机构" prop="institutionName">{{form.institutionName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="受训地址" prop="address">{{form.address}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="对方联系人" prop="institutionUser">{{form.institutionUser}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="对方联系方式" prop="institutionContact">{{form.institutionContact}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="课程名称" prop="courseName">{{form.courseName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="总课时" prop="courseTime">{{form.courseTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="开课时间" prop="beginTime">{{form.beginTime}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="结束时间" prop="endTime">{{form.endTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="培训经费" prop="founds">{{form.founds}}/人
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="培训摘要" prop="description">{{form.description}}
					</el-form-item>
					<el-form-item label="培训要求" prop="trainRequires">{{form.trainRequires}}
					</el-form-item>
					<el-form-item label="培训备注">{{form.remark}}
					</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			form: {
				recordId: '',
				sortNo: '',
				trainCode: '',
				title: '',
				userCount:'',
				channelName:'',
				courseTypeName: '',
				holdDept: '',
				chargePerson: "",
				institutionName: "",
				address: "",
				institutionUser: "",
				institutionContact: "",
				courseName: "",
				courseTime: "",
				beginTime:"",
				endTime:"",
				founds:"",
				approvedUser:"",
				joinDept:"",
				joinUserLevel:"",
				description:"",
				trainRequires:"",
				attachId: '',
				remark: ''
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model){
			this.model=model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data){
			this.form.recordId = data.recordId
			this.form.sortNo = data.sortNo
			this.form.trainCode = data.trainCode
			this.form.title = data.title
			this.form.userCount = data.userCount
			this.form.channelName = data.channelName
			this.form.courseTypeName = data.courseTypeName
			this.form.holdDept = data.holdDept
			this.form.chargePerson = data.chargePerson
			this.form.institutionName = data.institutionName
			this.form.address = data.address
			this.form.institutionUser = data.institutionUser
			this.form.institutionContact = data.institutionContact
			this.form.courseName = data.courseName
			this.form.courseTime = data.courseTime
			this.form.beginTime = data.beginTime
			this.form.endTime = data.endTime
			this.form.founds = data.founds
			this.form.approvedUser = data.approvedUser
			this.form.joinDept = data.joinDept
			this.form.joinUserLevel = data.joinUserLevel
			this.form.description = data.description
			this.form.trainRequires = data.trainRequires
			this.form.attachId = data.attachId
			this.form.remark = data.remark
		},
	}
}
</script>

<style>
</style>
